﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="contasReceber.aspx.cs" Inherits="Imobitech.Gestao.contasReceber" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
    </asp:ScriptManager>
    <asp:HiddenField ID="hdfConta" runat="server" />
    <fieldset>
        <div class="alert-message block-message">
            <div class="success" id="sucesso" runat="server">
            </div>
            <div class="error" id="error" runat="server">
            </div>
        </div>
        <div class="clearfix">
            <label>
                Tipo da conta:
            </label>
            <div class="input">
                <asp:DropDownList ID="ddlTipo" runat="server" CssClass="xlarge">
                    <asp:ListItem Text="Unitário" Value="1" Selected="True"></asp:ListItem>
                    <asp:ListItem Text="Mensal" Value="2"></asp:ListItem>
                    <asp:ListItem Text="Anual" Value="3"></asp:ListItem>
                </asp:DropDownList>
            </div>
        </div>
        <div class="clearfix">
            <label>
                Tipo da conta:
            </label>
            <div class="input">
                <asp:DropDownList ID="ddlCategoria" runat="server" CssClass="xlarge">
                </asp:DropDownList>
            </div>
        </div>
        <div class="clearfix">
            <label>
                Descricao:
            </label>
            <div class="input">
                <asp:TextBox ID="txtDescricao" runat="server" CssClass="xlarge"></asp:TextBox>
            </div>
        </div>
        <%-- <asp:UpdatePanel ID="updParcelas" runat="server" UpdateMode="Conditional">
            <ContentTemplate>--%>
        <div class="clearfix">
            <label>
                Número de Parcelas:
            </label>
            <div class="input">
                <asp:TextBox ID="txtParcelas" runat="server" CssClass="xlarge">
                </asp:TextBox>
            </div>
        </div>
        <div class="clearfix">
            <label>
                Parcelas:
            </label>
            <div class="input">
                <%--<div id="pnlParcelas" runat="server">
                            <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
                            <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
                        </div>--%>
                <asp:Repeater ID="rptParcelas" runat="server" OnItemDataBound="rptParcelas_ItemDataBound">
                    <HeaderTemplate>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <label>
                            Data de Vencimento:
                            <asp:TextBox ID='txtVencimento' runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "vencimentoFormat")%>'
                                Enabled="false"></asp:TextBox>
                            <br />
                            Data do Pagamento:
                            <asp:TextBox ID='txtPagamento' runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "datapago")%>'></asp:TextBox>
                            <br />
                            Valor:
                            <asp:TextBox ID='txtValor' runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "valorFormat")%>'
                                Enabled="false"></asp:TextBox>
                            <br />
                            Desconto:
                            <asp:TextBox ID='txtDesconto' runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "descontoFormat")%>'
                                Enabled="false"></asp:TextBox>
                            <br />
                            Acréscimo:
                            <asp:TextBox ID='txtAcrescimo' runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "acrescimoFormat")%>'
                                Enabled="false"></asp:TextBox>
                            <br />
                            Valor Pago:
                            <asp:TextBox ID='txtValorPago' runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "valorpago")%>'></asp:TextBox>
                            <br />
                            <asp:HiddenField ID="hdfPago" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "pago")%>' />
                            <asp:Button ID='btnPagar' CommandArgument='<%# DataBinder.Eval(Container.DataItem, "id")%>'
                                Text="Dar baixa em Recebimento" runat="server" OnClick="OnClick" />
                            <br />
                        </label>
                    </ItemTemplate>
                    <FooterTemplate>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
        </div>
        <%--</ContentTemplate>
        </asp:UpdatePanel>--%>
    </fieldset>
    <script type="text/javascript">
//<![CDATA[
        //        var theForm = document.forms['Form1'];
        //        if (!theForm) {
        //            theForm = document.Form1;
        //        }
        //        function __doPostBack(eventTarget, eventArgument) {
        //           // if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        //                theForm.__EVENTTARGET.value = eventTarget;
        //                theForm.__EVENTARGUMENT.value = eventArgument;
        //                theForm.submit();
        //          //  }
        //            }

        function __doPostBack(eventTarget, eventArgument) {
            if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
                theForm.__EVENTTARGET.value = eventTarget;
                theForm.__EVENTARGUMENT.value = eventArgument;
                theForm.submit();
            }
        }
//]]>

    </script>
</asp:Content>
